package code.structure.module.scene.view.bg
{
	import code.structure.manager.loader.DllLoaderManager;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	
	/**
	 *背景项 小块状的 
	 * @author Yuri
	 * 
	 */
	public class BackGroundItem extends Bitmap
	{
		private var _isLoadComplete:Boolean;
		public function BackGroundItem(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false)
		{
			super(bitmapData, pixelSnapping, smoothing);
		}
		
		/**
		 *加载素材 
		 * @param path
		 * 
		 */
		public function loadMaterial(path:String):void{
			DllLoaderManager.getInstance().getMaterial(path,"",onDllgetMaterialHandler,"png",2);
		}
		
		private function onDllgetMaterialHandler(bd:BitmapData,key:String = ""):void
		{
			// TODO Auto Generated method stub
			this.bitmapData = bd.clone();
			_isLoadComplete = true;
		}

		public function get isLoadComplete():Boolean
		{
			return _isLoadComplete;
		}

	}
}